//-----------------------------------------------------------
//
//-----------------------------------------------------------
class ZFGUI_Tab_SP extends ROUT2K4Tab_MainSP;

function InitGameType()
{
    local int i;
    local array<CacheManager.GameRecord> Games;
    local bool bReloadMaps;

    // Get a list of all gametypes.
    class'CacheManager'.static.GetGameTypeList(Games);
	for (i = 0; i < Games.Length; i++)
    {
        log("Games[i].ClassName="$ Games[i].ClassName);
        log("Controller.LastGameType="$Controller.LastGameType);

        if (Games[i].ClassName == "ZFCore.ZFGame")
        {
            CurrentGameType = Games[i];
            bReloadMaps = true;
            break;
        }
    }

	log("Current game type = "$CurrentGameType.ClassName);

    if ( i == Games.Length )
    	return;

    // Update the gametype label's text
    SetGameTypeCaption();

    // Load Maps for the new gametype, but only if it uses a different maplist
    if (bReloadMaps)
        InitMaps();

    // Set the selected map
    i = li_Maps.FindIndexByValue(LastSelectedMap);
    if ( i == -1 )
    	i = 0;
    li_Maps.SetIndex(i);
    li_Maps.Expand(i);
}

DefaultProperties
{

}
